<?php
class Zendvn_Paginator{
	
	public static function create($arrPanigator = null, $totalItem = null){
		
		//1. khai bao Adapter se su dung
		$adapter = new Zend_Paginator_Adapter_Null($totalItem);
		
		//2. Khoi tao doi tuong phan trang
		$panigator  = new Zend_Paginator($adapter);
		
		//3. Khai bao so phan tu tren mot trang
		$panigator->setItemCountPerPage($arrPanigator['rowCount']);
		
		//4. So trang se xuat hien
		$panigator->setPageRange($arrPanigator['pageRange']);
		
		//5.Trang hien thoi	
		
		$panigator->setCurrentPageNumber($arrPanigator['page']);
		
		return $panigator;
	}
}